{extend name='admin@public/content'}

{block name="style"}
<style>
    .keys-container{min-width:800px}
    .keys-container textarea{width:95%;height:100px;border-radius:0}
    .keys-container .input-group input{border-right:0}
    .keys-container .input-group-addon{border-left:0;border-radius:0}
    .keys-container [data-tips-image]{width:112px;height:auto;}
    .keys-container .layui-elem-field{width:100%;height:700px;position:absolute}
</style>
{/block}

{block name="content"}
<!-- 效果预览区域 结束 -->

<div class="row keys-container">
    <div class='col-xs-6 margin-left-15'>
        <form class="form-horizontal layui-form" role="form" data-auto="true" action="admin/Adminuserrole/postEdit" method="post">
            <fieldset class="layui-elem-field layui-box">
                <legend>{$title}</legend>
                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">会员等级名称</label>
                    <div class="col-xs-8">
                        <input required title='请输入会员等级名称' maxlength='20' name='name' class="layui-input" value='{$info.name|default=""}'>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">最小充值金额</label>
                    <div class="col-xs-8">
                        <input required  title='请输入最小充值金额' maxlength='20' name='money' class="layui-input" value='{$info.money|default=""}'>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">最大充值额度</label>
                    <div class="col-xs-8">
                        <input required type="text" required title='请输入最大充值额度' maxlength='20' name='new_recharge' class="layui-input" value='{$info.new_recharge|default=""}'>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">最大提现额度</label>
                    <div class="col-xs-8">
                        <input required type="text" required title='请输入最大提现额度' maxlength='20' name='new_putmoney' class="layui-input" value='{$info.new_putmoney|default=""}'>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">最大消费额度</label>
                    <div class="col-xs-8">
                        <input required title='请输入最大消费额度' maxlength='20' name='max_pay' class="layui-input" value='{$info.max_pay|default=""}'>
                    </div>
                </div>
                {foreach $info['desc'] as $v}
                    <div class="form-group">
                        <label class="col-xs-2 control-label layui-form-label ">{$v.name}</label>
                        <div class="col-xs-8">
                            <input required title='开通条件' maxlength='20' name='{$v.id}' class="layui-input" value='{$v.data|default=""}'>
                        </div>
                    </div>
                {/foreach}

                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label label-required">状态</label>
                    <div class="col-xs-8">
                        <div class="mt-radio-inline padding-bottom-0">
                            <label class="think-radio">
                                <!---->
                                <input data-auto-none="" type="radio" <?php if($info['status'] ==1){?>checked <?php }?>  name="status"  value="1" > 正常                                <!---->
                            </label>
                            <label class="think-radio">
                                <!---->
                                <input data-auto-none="" type="radio" name="status"  <?php if($info['status'] ==0){?>checked <?php }?> value="0"> 禁用                                <!---->
                            </label>
                        </div>
                    </div>
                </div>

                <div class="text-center padding-bottom-10" style="position:absolute;bottom:0;width:100%;">
                    <div class="hr-line-dashed" style="margin:10px 0"></div>
                    <button class="layui-btn menu-submit">保存数据</button>
                    <!--{if !isset($vo.keys) || !in_array($vo.keys,['default','subscribe'])}-->
                    <button data-cancel-edit class="layui-btn layui-btn-danger" type='button'>取消编辑</button>
                    <!--{/if}-->
                </div>
                {if isset($info['id'])}<input type='hidden' value='{$info.id}' name='id'>{/if}

            </fieldset>
        </form>
    </div>
</div>
{/block}

{block name="script"}
<script>
    $(function (){
        var $body = $('body');
        /*! 取消编辑 */
        $('[data-cancel-edit]').on('click', function (){
            var dialogIndex = $.msg.confirm('确定取消编辑吗？', function (){
                history.back();
                $.msg.close(dialogIndex);
            });
        });
        // 默认事件触发
        $('input[name=type]:checked').map(function (){
            $(this).trigger('click');
        });
    });
</script>
{/block}